package exam122011;
/***********************************************************************
 * Module:  Processeur.java
 * Author:  29004847
 * Purpose: Defines the Class Processeur
 ***********************************************************************/

import java.util.*;

/** @pdOid e9331a38-11ac-416a-80c6-b8613681720a */
public class Processeur implements Element {
	public Processeur() {
		super();
		this.coeurs = new ArrayList<CoeurProc>();
		this.id = new String();
	}

	/** @pdOid 3d32b8e0-cdd2-4e14-9bc9-7b4ebab2e3c7 */
	private String id;

	/** @pdRoleInfo migr=no name=CoeurProc assc=association6 coll=java.util.List impl=java.util.ArrayList mult=0..* */
	private java.util.List<CoeurProc> coeurs;


	/** @pdGenerated default iterator getter */
	public java.util.Iterator getIteratorCoeurs() {
		if (coeurs == null)
			coeurs = new java.util.ArrayList<CoeurProc>();
		return coeurs.iterator();
	}

	/** @pdGenerated default add
	 * @param newCoeurProc */
	public void addCoeurs(CoeurProc newCoeurProc) {
		if (newCoeurProc == null)
			return;
		if (this.coeurs == null)
			this.coeurs = new java.util.ArrayList<CoeurProc>();
		if (!this.coeurs.contains(newCoeurProc))
			this.coeurs.add(newCoeurProc);
	}

	/** @pdGenerated default remove
	 * @param oldCoeurProc */
	public void removeCoeurs(CoeurProc oldCoeurProc) {
		if (oldCoeurProc == null)
			return;
		if (this.coeurs != null)
			if (this.coeurs.contains(oldCoeurProc))
				this.coeurs.remove(oldCoeurProc);
	}

	@Override
	public void accept(Visitor v) {
		v.visitProcesseur(this);	
	}

}